home *** CD-ROM | disk | FTP | other *** search
/ LinearView - Product Data & Applications 1 / LinearView - Product Data & Applications.iso / install / linear.rul
Encoding:
Text File  |  1996-07-09  |  29.3 KB  |  743 lines

  1. /*----------------------------------------------------------------------------*\
  2.  *
  3.  *  DDDDDD  WW    WW TTTTTTTT IIIIIIII       (C)Copyright 1996
  4.  *  DD   DD WW    WW TTTTTTTT    II          Dataware Technologies, Inc.
  5.  *  DD   DD WW WW WW    TT       II          Boulder, Colorado
  6.  *  DD   DD WWW  WWW    TT       II
  7.  *  DDDDDD   W    W     TT    IIIIIIII
  8.  *
  9.  *
  10.  *   This installation program uses InstallShield(R) 3 and installs 
  11.  *   Linear Technlogy's LinearView Application
  12.  *
  13.  *
  14.  *    File Name:  LINEAR.RUL
  15.  *
  16.  *  Description:  Linear Technology
  17.  *                16-bit script.
  18.  *
  19.  *
  20.  *       Author:  Raymond Bridge             6/23/96, et seq.
  21.  *                revised Raymond Bridge        7/6/96, 7/9/96 
  22.  *
  23.  *     Comments:  
  24.  *                
  25.  *                
  26.  *                
  27.  *                
  28.  *                
  29.  *
  30.  *
  31.  *
  32. \*----------------------------------------------------------------------------*/
  33.  
  34.  
  35. declare
  36.  
  37. #include "sddialog.h"
  38. // Constant declarations.
  39. #define APP_NAME                "LinearView"
  40. #define UNINSTALL_NAME                "LinearView"
  41. #define PROGRAM_FOLDER_NAME     "Linear Technology"
  42. #define APPBASE_PATH            "Linear"
  43.  
  44. #define COMPANY_NAME            "Linear Technology"
  45. #define PRODUCT_NAME            "LinearView"
  46. #define PRODUCT_VERSION         "1.0"
  47. #define DEINSTALL_KEY           "LinearDeinstKey"
  48. #define PRODUCT_KEY             "linear.exe"
  49.  
  50.         // Global variable declarations.
  51.         STRING  svFolder, svDir, szMsg, szFileSet, szTitle, szComponents, svComponent, 
  52.                 svUninstLogFile, szIniFile, szSection, szLine, svInstalledFile, 
  53.                 svDummyResult, svGroupPath;
  54.         STRING  svTarget[ 255 ], szDrive, szPath[255], szProgram, szTemp[ 255 ], szOLE;
  55.         BOOL    bSpaceOk;
  56.         BOOL    bLinear;    //Flag currently used to determine whether to install main program files
  57.         BOOL    bAcrobat;    //Flag currently used to determine whether run Acrobat setup
  58.         BOOL    bSwitcher;    //Flag currently used to determine whether run SwitcherCAD install
  59.         BOOL    bFilter;    //Flag currently used to determine whether to run FilterCAD install
  60.         BOOL    bSpice;    //Flag currently used to determine whether to run Spice install
  61.         BOOL    bNoise;    //Flag currently used to determine whether to run Noise install
  62.         NUMBER  lResult, nResult, nvItemCount;
  63.         NUMBER  nvResult;   // Result from system information call
  64.         STRING  svResult;    // Result from system information call
  65.         NUMBER  nOS;        // Operating system
  66.         STRING  sOS;        // Operating system    string representation
  67.         NUMBER  nWinMajor;    // Windows major version number
  68.         NUMBER  nWinMinor;    // Windows minor version number
  69.         STRING  sWinMajor;    // Windows major version number
  70.         STRING  sWinMinor;    // Windows minor version number
  71.         NUMBER  nOSMajor;    // OS major version number
  72.         NUMBER  nOSMinor;    // OS minor version number
  73.         NUMBER  nvFileHandle;
  74.         NUMBER  nvSize, nFreeSpace, nSpaceRequired;    /* For disk space checking */
  75.         NUMBER  nFileCount, nSize, nDone;        // Computing progress
  76.                 LIST    listSpace;        /* For totalling disk space */
  77.         LIST    listInfo;        /* Information dialogs contents */
  78.  
  79.         // Function declarations.
  80.         prototype SetupScreen();
  81.         prototype CheckRequirements();
  82.         prototype Ole2Dll();
  83.  
  84. program
  85.  
  86. StartHere:
  87.         Disable( BACKGROUND );
  88.  
  89.         // Set installation info., which is required for registry entries.
  90.         InstallationInfo( COMPANY_NAME, PRODUCT_NAME, PRODUCT_VERSION, PRODUCT_KEY );
  91.  
  92.         // Set up the installation screen.
  93.         SetupScreen();
  94.         Enable( DIALOGCACHE );
  95.  
  96.         CheckRequirements();  /* Just does screen at the moment.    */
  97.  
  98.    // Create a Welcome dialog.
  99.    WelcomeDlg:
  100.         Disable( BACKBUTTON );
  101.         Welcome( "", 0 );
  102.         Enable( BACKBUTTON );
  103.  
  104.    IntroDlg:
  105.         listInfo = ListCreate(STRINGLIST);
  106.         szTitle = "LinearView Installation";
  107.         ListAddString(listInfo,"LinearView is Linear Technology Corporation's electronic publication",AFTER);
  108.         ListAddString(listInfo,"access software.  Together with the information stored on the ",AFTER);
  109.         ListAddString(listInfo,"associated CDROM, this program allows anyone to access, search, ",AFTER);
  110.         ListAddString(listInfo,"view, and print data sheets, application notes, and other publications ",AFTER);
  111.         ListAddString(listInfo, "covering LTC products.", AFTER);
  112.         ListAddString(listInfo, "", AFTER);
  113.         ListAddString(listInfo, "LinearView and Adobe Acrobat installations are required to view the", AFTER);
  114.         ListAddString(listInfo, "documents stored on the CDROM.", AFTER);
  115.         ListAddString(listInfo, "", AFTER);
  116.         ListAddString(listInfo, "Four additional design aids are included on the CDROM: Switcher-", AFTER);
  117.         ListAddString(listInfo, "CAD, FilterCAD, Spice, and Noise.  These programs can be started", AFTER);
  118.         ListAddString(listInfo, "from within LinearView if installed along with LinearView (or if ", AFTER);
  119.         ListAddString(listInfo, "LINEAR.INI is updated with a path if the design aids are installed", AFTER);
  120.         ListAddString(listInfo, "at a later time).", AFTER);
  121.         ListAddString(listInfo, "", AFTER);
  122.         ListAddString(listInfo, "The programs will not successfully operate from the CDROM and", AFTER);
  123.         ListAddString(listInfo, "must be installed onto a hard drive for proper operation.", AFTER);
  124.         nResult = SdShowInfoList(szTitle, "", listInfo);
  125.         if (nResult = 12) then
  126.             goto WelcomeDlg;
  127.         endif;
  128.         if (nResult = NEXT) then
  129.             Disable(DIALOGCACHE);
  130.             Enable(DIALOGCACHE);
  131.             MessageBox("Please take a moment to read the following screens carefully.\nWe know it's a pain, but a little time spent now will result in a satisfactory installation.",
  132.             INFORMATION);
  133.         endif;
  134.  
  135.     ExtrasDlg:
  136.         listInfo = ListCreate(STRINGLIST);
  137.         szTitle = "LinearView Installation";
  138.         ListAddString(listInfo,"SwitcherCAD",AFTER);
  139.         ListAddString(listInfo, "", AFTER);
  140.         ListAddString(listInfo, "SwitcherCAD is a powerful aid for designing DC-DC converters", AFTER);
  141.         ListAddString(listInfo, "that incorporate Linear Technology Corporation's switching", AFTER);
  142.         ListAddString(listInfo, "regulator ICs.  Its use saves time by eliminating searches", AFTER);
  143.         ListAddString(listInfo, "through multiple datasheets, application notes, and magazine", AFTER);
  144.         ListAddString(listInfo, "articles for possible design solutions.", AFTER);
  145.         ListAddString(listInfo, "", AFTER);
  146.         ListAddString(listInfo, "The program requires the user to enter values for a small", AFTER);
  147.         ListAddString(listInfo, "set of basic parameters. Based on these inputs, SwitcherCAD", AFTER);
  148.         ListAddString(listInfo, "selects one or more LTC ICs and circuit topologies that", AFTER);
  149.         ListAddString(listInfo, "satisfy the design.  The program also selects the necessary", AFTER);
  150.         ListAddString(listInfo, "external components such as input and output capacitors,", AFTER);
  151.         ListAddString(listInfo, "diodes, and inductors.  The design results, parts list,", AFTER);
  152.         ListAddString(listInfo, "and schematic can be printed.", AFTER);
  153.         ListAddString(listInfo, "", AFTER);
  154.         ListAddString(listInfo, "FilterCAD", AFTER);
  155.         ListAddString(listInfo, "", AFTER);
  156.         ListAddString(listInfo, "FilterCAD is a computer-aided design program that eases the", AFTER);
  157.         ListAddString(listInfo, "design of circuits using Linear Technology Corporation's", AFTER);
  158.         ListAddString(listInfo, "switched-capacitor filter IC family.  FilterCAD supports the", AFTER);
  159.         ListAddString(listInfo, "LTC1059, 1059A, 1060, 1060A, 1061, 1064, 1064A, and 1164.", AFTER);
  160.         ListAddString(listInfo, "This program requires minimal effort, making it easy for", AFTER);
  161.         ListAddString(listInfo, "everyone to design filters.  Experienced filter designers ", AFTER);
  162.         ListAddString(listInfo, "can interactively alter component values, observe a circuit's", AFTER);
  163.         ListAddString(listInfo, "performance, and fine tune for best results.", AFTER);
  164.         ListAddString(listInfo, "", AFTER);
  165.         ListAddString(listInfo, "FilterCAD handles any of the four major filter transfer functions", AFTER);
  166.         ListAddString(listInfo, "(low-pass, bandpass, notch, and high-pass) that use Butterworth,", AFTER);
  167.         ListAddString(listInfo, "Chebyshev, Elliptic, or custom-designed response character-", AFTER);
  168.         ListAddString(listInfo, "istics.  FilterCAD's designs are based on cascading state-", AFTER);
  169.         ListAddString(listInfo, "variable second-order sections.  The program generates plots", AFTER);
  170.         ListAddString(listInfo, "of amplitude, phase, and group-delay, selects appropriate ", AFTER);
  171.         ListAddString(listInfo, "devices and mode, and calculates resistor values.  The design", AFTER);
  172.         ListAddString(listInfo, "results, parts list, and schematic can be printed.", AFTER);
  173.         ListAddString(listInfo, "", AFTER);
  174.         ListAddString(listInfo, "Spice Macromodel", AFTER);
  175.         ListAddString(listInfo, "", AFTER);
  176.         ListAddString(listInfo, "Spice Macromodel contains an LTC op amp SPICE macromodel", AFTER);
  177.         ListAddString(listInfo, "library that can be used with any version of SPICE or the", AFTER);
  178.         ListAddString(listInfo, "demonstration version of PSpice[TM] (from MicroSim) included", AFTER);
  179.         ListAddString(listInfo, "with this library. This library allows users to simulate general", AFTER);
  180.         ListAddString(listInfo, "analog circuits.", AFTER);
  181.         ListAddString(listInfo, "", AFTER);
  182.         ListAddString(listInfo, "Noise", AFTER);
  183.         ListAddString(listInfo, "", AFTER);
  184.         ListAddString(listInfo, "Noise is a program that calculates noise of circuits using LTC", AFTER);
  185.         ListAddString(listInfo, "operational amplifiers.  The program can select the best op amp ", AFTER);
  186.         ListAddString(listInfo, "for low noise applications, displays op amp noise data, calculates", AFTER);
  187.         ListAddString(listInfo, "resistor noise, and calculate noise using specifications for any", AFTER);
  188.         ListAddString(listInfo, "op amp.", AFTER);
  189.         if (SdShowInfoList(szTitle, "", listInfo) = 12) then
  190.             goto IntroDlg;
  191.         endif;
  192.  
  193.            Disable(DIALOGCACHE);
  194.            Enable(DIALOGCACHE);
  195.  
  196.         // Test target system for proper configuration.
  197.  
  198.         if(GetSystemInfo(OS,nvResult,svResult) < 0) then
  199.             MessageBox("Couldn't get Operating System information!", WARNING);
  200.             else switch(nvResult)
  201.                 case IS_WINDOWS:
  202.                     sOS = "Windows";
  203.                 case IS_WINDOWSNT:
  204.                     sOS = "Windows NT";
  205.                 case IS_WINDOWS95:
  206.                     sOS = "Windows 95";
  207.                 case IS_WIN32S:
  208.                     sOS = "Win32s";
  209.                 endswitch;
  210.             endif;
  211.  
  212.         if(GetSystemInfo(WINMAJOR,nvResult,svResult) < 0) then
  213.             MessageBox("Couldn't get Windows major version information!", WARNING);
  214.             else
  215.                 sWinMajor = svResult;
  216.                 nWinMajor = nvResult;
  217.             endif;
  218.  
  219.         if(GetSystemInfo(WINMINOR,nvResult,svResult) < 0) then
  220.             MessageBox("Couldn't get Windows minor version information!", WARNING);
  221.             else
  222.                 sWinMinor = svResult;
  223.                 nWinMinor = nvResult;
  224.             endif;
  225.         if(GetSystemInfo(OSMAJOR,nvResult,svResult) < 0) then
  226.             MessageBox("Couldn't get Operating System major version information!", WARNING);
  227.             else
  228.                 nOSMajor = nvResult;
  229.             endif;
  230.  
  231.         if(GetSystemInfo(OSMINOR,nvResult,svResult) < 0) then
  232.             MessageBox("Couldn't get Operating System minor version information!", WARNING);
  233.             else
  234.                 nOSMinor = nvResult;
  235.             endif;
  236. /* for DEBUG                       
  237.         szMsg = "Operating system is %s, version %s\n" +
  238.             "Windows Major version: %d\n" +
  239.             "Windows Minor version: %d\nOperating System Major version: %d\n" +
  240.             "Operating System Minor version: %d";
  241.  
  242.         SprintfBox(INFORMATION, "Debugging",szMsg,sOS, sWinMajor, nWinMajor, nWinMinor, nOSMajor, nOSMinor);
  243. */        
  244. // Section below replaces use of WinMinor, which appears to be buggy
  245. // If Windows 3.1x, test for vshare, and, if not present, offer to add.
  246.         if(sOS = "Windows") then
  247.             if(FindFile(WINSYSDIR,"vshare.386",svDummyResult)<0) then
  248.                 szMsg = "Setup has detected that you are running Windows and that you do not\n" +
  249.                 "have VSHARE loaded with Windows. VSHARE may be required to view the images\n" +
  250.                 "within the LinearView application. Would you like to have Setup\n" +
  251.                 "add VSHARE to your system?";
  252.                 SetDialogTitle(DLG_ASK_YESNO, "Install VSHARE?");
  253.                 if(AskYesNo(szMsg, YES) = YES) then
  254.                     VarSave(SRCTARGETDIR);
  255.                     TARGETDIR = WINSYSDIR;
  256.                     SRCDIR = SRCDIR ^ APPBASE_PATH;    // SHOULD BE CHANGED TO ALLOW RUNNING FROM ARBITRARY ROOT
  257.                     CopyFile("VSHARE.386","VSHARE.386");
  258.                     VarRestore(SRCTARGETDIR);
  259.                     szPath = WINDIR ^ "SYSTEM.INI";
  260.                     AddProfString(szPath ,"386Enh","device","vshare.386");
  261.                 endif;
  262.             endif;
  263.         endif;
  264.  
  265.  
  266.  
  267.         // Ask user for a destination location for the installation.
  268.    GetOptions:
  269.          szTitle = "LinearView Installation Options";
  270.  
  271.         svTarget = TARGETDISK ^ APPBASE_PATH;
  272.         szMsg = "Install the following components:";
  273.         szComponents = "LinearView";
  274.         ComponentAddItem(szComponents, "LinearView Program (Required)", 5000000, TRUE);
  275.  
  276.         ComponentAddItem(szComponents, "Acrobat Exchange (Required)", 7000000, TRUE);
  277.         ComponentAddItem(szComponents, "SwitcherCAD (Optional)", 966000, FALSE);
  278.         ComponentAddItem(szComponents, "FilterCAD (Optional)", 332000, FALSE);
  279.         ComponentAddItem(szComponents, "Spice (Optional)", 1000000, FALSE);
  280.         ComponentAddItem(szComponents, "Noise (Optional)", 71000, FALSE);
  281.         if ( SdComponentDialogAdv( szTitle, szMsg, svTarget, szComponents ) = 12 ) then
  282.            goto ExtrasDlg;
  283.         endif;
  284.  
  285.         
  286. ComputeSpace:
  287.     bLinear = FALSE;    
  288.     bAcrobat = FALSE;    
  289.     bSwitcher = FALSE;
  290.     bFilter = FALSE;    
  291.     bSpice = FALSE;
  292.     bNoise = FALSE;
  293.     listSpace = ListCreate(STRINGLIST);
  294.     nSpaceRequired = 0;
  295.     ComponentListItems(szComponents, listSpace);
  296.     nResult = ListGetFirstString(listSpace, svComponent);
  297.     nFileCount = 0;
  298.     while(nResult = 0)
  299.         ComponentGetItemSize(szComponents, svComponent, nvSize);
  300.         if(ComponentIsItemSelected(szComponents, svComponent)) then
  301.             nSpaceRequired = nSpaceRequired + nvSize;
  302.             if(svComponent = "LinearView Program (Required)") then
  303.                 bLinear = TRUE;    
  304.                 nFileCount = nFileCount + 8;
  305.             endif;
  306.             if(svComponent = "Acrobat Exchange (Required)") then
  307.                 bAcrobat = TRUE;    
  308.             endif;
  309.             if(svComponent = "SwitcherCAD (Optional)") then
  310.                 bSwitcher = TRUE;
  311.                 nFileCount = nFileCount + 16;
  312.             endif;
  313.             if(svComponent = "FilterCAD (Optional)") then
  314.                 bFilter = TRUE;    
  315.                 nFileCount = nFileCount + 18;
  316.             endif;
  317.             if(svComponent = "Spice (Optional)") then
  318.                 bSpice = TRUE;
  319.             endif;
  320.             if(svComponent = "Noise (Optional)") then
  321.                 bNoise = TRUE;
  322.                 nFileCount = nFileCount + 1;
  323.             endif;
  324.         endif;
  325.         
  326.         nResult = ListGetNextString(listSpace, svComponent);
  327.     endwhile;
  328.  
  329.     // Perform space check of target drive.
  330.     bSpaceOk = TRUE;
  331.     if (GetDiskSpace( svTarget ) < nSpaceRequired) then
  332.        szMsg = "There is not enough space available on the disk\n" +
  333.                "'" + svTarget + "' \n" +
  334.                "Please free up some space or change the target location\n" +
  335.                "to a different disk";
  336.        MessageBox( szMsg, WARNING );
  337.        bSpaceOk = FALSE;
  338.     endif;
  339.         
  340.         
  341.  
  342.     
  343.  
  344.         // If not enough space, ask user to try again.
  345.         if (bSpaceOk = FALSE) then
  346.             goto GetOptions;
  347.         endif;
  348.  
  349.  
  350.    SetupFilesToTransfer:
  351.         SRCDIR = SRCDISK;
  352.  
  353. //CALCULATE STATUS BAR PERCENTAGES
  354.         nSize = 1;    // allow for other tasks at end to calculate percentages
  355.         if(bLinear = TRUE) then
  356.             nSize = nSize + 40;
  357.         endif;
  358.         if(bAcrobat = TRUE) then
  359.             nSize = nSize + 70;
  360.         endif;
  361.         if(bSpice = TRUE) then
  362.             nSize = nSize + 15;
  363.         endif;
  364.         if(bNoise = TRUE) then
  365.             nSize = nSize + 1;
  366.         endif;
  367.         if(bSwitcher = TRUE) then
  368.             nSize = nSize + 10;
  369.         endif;
  370.         if(bFilter = TRUE) then
  371.             nSize = nSize + 3;
  372.         endif;
  373.  
  374.  
  375.              TARGETDIR = svTarget;
  376.             DeinstallStart(svTarget, svUninstLogFile, DEINSTALL_KEY, 0);
  377.             RegDBSetItem(REGDB_UNINSTALL_NAME, UNINSTALL_NAME);
  378.             StrSub(szDrive,svTarget,0,2);
  379.             TARGETDISK = szDrive;
  380.  
  381. SelectFldr:
  382.    svFolder = PROGRAM_FOLDER_NAME;    //Default folder name
  383.    szTitle = "Select Program Folder";
  384.    szMsg = "Setup will add the LinearView items to the folder " +
  385.            "in the Program Folders field.\n  You can type a new " +
  386.            "folder name or select one from the list of existing " +
  387.            "folders.";
  388.    SdSelectFolder(szTitle, szMsg, svFolder);
  389.    if(QueryProgGroup(svFolder, svGroupPath, nvItemCount) < 0) then
  390.            SetDialogTitle(DLG_ASK_YESNO, "Create Folder?");
  391.         if(AskYesNo("This folder does not exist. " +
  392.             "Should Setup create it?", YES) = YES) then
  393.             CreateProgGroupEx(svFolder,"");
  394.         else
  395.             goto SelectFldr;
  396.         endif;
  397.    endif;
  398.  
  399.         Disable( DIALOGCACHE );
  400.         Enable(INDVFILESTATUS);
  401.             Enable(STATUS);
  402.             if(bAcrobat = TRUE) then
  403.                 StatusUpdate( ON, 25 );
  404.             else
  405.                 StatusUpdate( ON, 35 );
  406.             endif;
  407.             SetStatusWindow(0, "Copying LinearView program files...");
  408.             if(bLinear = TRUE) then
  409.                 VarSave(SRCTARGETDIR);
  410.                 SRCDIR = SRCDIR ^ APPBASE_PATH;    // SHOULD BE CHANGED TO ALLOW RUNNING FROM ARBITRARY ROOT
  411.                 CopyFile("ADL.DLL","ADL.DLL");
  412.                 CopyFile("ADL_MSGS.ENG","ADL_MSGS.ENG");
  413.                 CopyFile("LINEAR.EXE","LINEAR.EXE");
  414.                 CopyFile("MFC250.DLL","MFC250.DLL");
  415.                 CopyFile("TABDLL11.DLL","TABDLL11.DLL");
  416.                 CopyFile("CPDFVIEW.DLL","CPDFVIEW.DLL");
  417.                 CopyFile("README.TXT","README.TXT");
  418.                 CopyFile("LINEAR.HLP","LINEAR.HLP");
  419.                 CopyFile("GX1116R.DLL","GX1116R.DLL");
  420.                 CopyFile("MFCOLEUI.DLL","MFCOLEUI.DLL");
  421.                 VarRestore(SRCTARGETDIR);
  422.                  nDone = nDone + 40;
  423.             endif;
  424.             if(bSwitcher = TRUE) then
  425.                 SetStatusWindow(nDone/nSize, "Copying SwitcherCAD files...");
  426.                 VarSave(SRCTARGETDIR);
  427.                 SRCDIR = SRCDIR ^ "SWCAD";
  428.                 TARGETDIR = TARGETDIR ^ "SWCAD";
  429.                 XCopyFile("*.*","*.*",INCLUDE_SUBDIR);
  430.                 VarRestore(SRCTARGETDIR);
  431.                  nDone = nDone + 10;
  432.             endif;
  433.             if(bFilter = TRUE) then
  434.                 SetStatusWindow(nDone/nSize, "Copying FilterCAD files...");
  435.                 VarSave(SRCTARGETDIR);
  436.                 SRCDIR = SRCDIR ^ "FCAD";
  437.                 TARGETDIR = TARGETDIR ^ "FCAD";
  438.                 XCopyFile("*.*","*.*",INCLUDE_SUBDIR);
  439.                 VarRestore(SRCTARGETDIR);
  440.                  nDone = nDone + 3;
  441.             endif;
  442.             if(bNoise = TRUE) then
  443.                 SetStatusWindow(nDone/nSize, "Copying Noise files...");
  444.                 VarSave(SRCTARGETDIR);
  445.                 SRCDIR = SRCDIR ^ "NOISE";
  446.                 TARGETDIR = TARGETDIR ^ "NOISE";
  447.                 XCopyFile("*.*","*.*",INCLUDE_SUBDIR);
  448.                 VarRestore(SRCTARGETDIR);
  449.                  nDone = nDone + 1;
  450.             endif;
  451.             if(bSpice = TRUE) then
  452.                 SetStatusWindow(nDone/nSize, "Copying Spice files...");
  453.                 VarSave(SRCTARGETDIR);
  454.                 SRCDIR = SRCDIR ^ "SPICE";
  455.                 TARGETDIR = TARGETDISK ^ "SPICE";
  456.                 XCopyFile("*.*","*.*",INCLUDE_SUBDIR);
  457.                 VarRestore(SRCTARGETDIR);
  458.                  nDone = nDone + 15;
  459.             endif;
  460.             SetStatusWindow(nDone/nSize, "Updating system...");
  461.             if((sOS = "Windows") || (sOS = "Windows 95")) then
  462. /* for DEBUG            
  463.                 MessageBox("DEBUG: - Reached IF Windows!", INFORMATION);
  464. */                
  465.                 VarSave(SRCTARGETDIR);
  466.                 TARGETDIR = WINSYSDIR;
  467.                 SRCDIR = SRCDIR ^ APPBASE_PATH;    // SHOULD BE CHANGED TO ALLOW RUNNING FROM ARBITRARY ROOT
  468.                 CopyFile("LINEAR.FON","LINEAR.FON");
  469.                 VarRestore(SRCTARGETDIR);
  470.                 szPath = WINDIR ^ "WIN.INI";
  471.                 WriteProfString(szPath,"fonts","Linear","LINEAR.FON");
  472.                 
  473.                 WriteProfString("","","",""); // If moved to Win95, this flushes buffer
  474.                 Disable(LOGGING);
  475.                 Ole2Dll();
  476.                 Enable(LOGGING);
  477.             endif;
  478. CreateIniFile:
  479. if(bLinear = TRUE) then
  480.     szIniFile = svTarget ^ "LINEAR.INI";
  481.     szMsg = "Unable to write to INI file.";
  482.     if (CreateFile(nvFileHandle, svTarget, "LINEAR.INI") = 0) then
  483.         WriteLine(nvFileHandle, "[Main]");        
  484.         WriteLine(nvFileHandle, "Window=1");        
  485.         WriteLine(nvFileHandle, "Width=640");        
  486.         WriteLine(nvFileHandle, "Height=480");        
  487.         WriteLine(nvFileHandle, "");        
  488.         WriteLine(nvFileHandle, "[Paths]");        
  489.         szLine = "PFT=" + SRCDISK ^ "DSR";
  490.         WriteLine(nvFileHandle, szLine);        
  491.         szLine = "TOC=" + SRCDISK ^ "DSR";
  492.         WriteLine(nvFileHandle, szLine);        
  493.         szLine = "ADL=" + SRCDISK ^ "DATABASE";
  494.         WriteLine(nvFileHandle, szLine);        
  495.         szLine = "PDF=" + SRCDISK;
  496.         WriteLine(nvFileHandle, szLine);        
  497.         szLine = "Sales=" + SRCDISK ^ "LINEAR\\SALES.PDF";
  498.         WriteLine(nvFileHandle, szLine);        
  499.         szLine = "Tree=" + SRCDISK ^ "DSR\\TREE.DSR";
  500.         WriteLine(nvFileHandle, szLine);        
  501.         WriteLine(nvFileHandle, "");        
  502.         WriteLine(nvFileHandle, "[Launch]");        
  503.         szLine = "PNMovie=" + SRCDISK ^ "LINEAR\\PARTNO.EXE";
  504.         WriteLine(nvFileHandle, szLine);
  505.         szLine = "KWMovie=" + SRCDISK ^ "LINEAR\\KEYWORD.EXE";
  506.         WriteLine(nvFileHandle, szLine);
  507.         szLine = "OAMovie=" + SRCDISK ^ "LINEAR\\OPAMP.EXE";
  508.         WriteLine(nvFileHandle, szLine);
  509.         if (bNoise = TRUE) then        
  510.             szLine = "Noise=" + TARGETDIR ^ "NOISE\\NOISE.EXE";
  511.             WriteLine(nvFileHandle, szLine);
  512.         endif;        
  513.         if (bSwitcher = TRUE) then        
  514.             szLine = "Switcher=" + TARGETDIR ^ "SWCAD\\SCAD.EXE";
  515.             WriteLine(nvFileHandle, szLine);
  516.         endif;        
  517.         if (bFilter = TRUE) then        
  518.             szLine = "Filter=" + TARGETDIR ^ "\FCAD\\FCAD.EXE";
  519.             WriteLine(nvFileHandle, szLine);
  520.         endif;        
  521.         if (bSpice = TRUE) then        
  522.             szLine = "Spice=" + TARGETDISK ^ "SPICE\\PSPICE1.EXE";
  523.             WriteLine(nvFileHandle, szLine);
  524.         endif;        
  525.     
  526.     else
  527.         szMsg = "Unable to create " + szIniFile;
  528.         MessageBox(szMsg, WARNING);
  529.     endif;
  530. endif; 
  531.  
  532.  
  533.  
  534.  
  535.    // Create program folders and icons.
  536. InstallProgramItems:
  537.         SetStatusWindow( 95, "Creating Program Group and Icons...." );
  538.         Delay(1);
  539.  
  540.         AppCommand( PROGMAN, CMD_RESTORE );
  541.  
  542.         szProgram = svTarget ^ "LINEAR.EXE";
  543.  
  544.         ShowProgramFolder( svFolder, SW_SHOW );
  545.  
  546.         AddFolderIcon( svFolder, APP_NAME,
  547.                        szProgram,
  548.                        svTarget,
  549.                        "", 0, "", REPLACE );
  550.         Delay( 1 );
  551.  
  552. /*   
  553.         AddFolderIcon( svFolder, "LinearView Help",
  554.                        "WINHELP.EXE" + " " + svTarget ^ "LINEAR.HLP",
  555.                        svTarget,
  556.                        "", 0, "", REPLACE );
  557.         Delay( 1 );
  558. */
  559. /*
  560.         AddFolderIcon( svFolder, "Readme ",
  561.                        "NOTEPAD.EXE " + svTarget ^ "README.TXT",
  562.                        svTarget,
  563.                        "", 0, "", REPLACE );
  564.         Delay( 1 );
  565. */
  566.         // UNINST global variable stores the file name (with full path) of
  567.         // the uninstaller file.
  568.         szProgram = UNINST;
  569.         szProgram = szProgram + " -f" + svUninstLogFile;
  570.         AddFolderIcon( svFolder, "unInstallSHIELD", szProgram,
  571.                        WINDIR,
  572.                        "", 0, "", REPLACE );
  573.         Delay( 1 );
  574.  
  575.    // Announce setup complete and offer to read README file.
  576.    FinalInstallProcess:
  577.            szMsg =    "Main Installation complete.";
  578.         SetStatusWindow( 100, szMsg  );
  579.         Delay(2);
  580.         Disable(STATUS);
  581.  
  582. /*  This stuff implements the old batch file method.  May have a drive letter bug.
  583.         if(bSpice = TRUE) then
  584.             szMsg = "SPICE installation will now commence.";
  585.             MessageBox(szMsg, INFORMATION);
  586.         endif;
  587.  
  588.         if (bSpice = TRUE) then
  589.            LaunchAppAndWait( SRCDISK ^ "SPICE\\XCPY2DSC.BAT", SRCDISK ^ "SPICE " + TARGETDISK ^ "SPICE", NOWAIT );
  590.            Delay(2);
  591.         endif;
  592. */
  593.  
  594.         if(bAcrobat = FALSE) then
  595.             szMsg = "Setup is complete.  You may run the installed program "+
  596.                 "by double-clicking on the program icon installed.";
  597.         else
  598.             szMsg = "The Adobe Acrobat Setup Program will now be launched...";
  599.         endif;
  600.                 
  601.         MessageBox( szMsg, INFORMATION );
  602.         if(bAcrobat = TRUE) then
  603.             szPath = SRCDISK ^ "acroexch\\disk1\\acroinst.exe";
  604.             nvResult = LaunchApp(szPath,"");
  605.             if (nvResult != 0) then
  606.                 MessageBox("Acrobat Installation is unable to start.",WARNING);
  607.             endif;
  608.             
  609.         endif;
  610.  
  611.         exit;
  612.  
  613.  
  614. /*---------------------------------------------------------------------------*\
  615.  *
  616.  * Function:  SetupScreen
  617.  *
  618.  *  Purpose:  This function will set up the screen look.  This includes
  619.  *            colors, fonts, text to be displayed, etc.
  620.  *
  621.  *
  622.  *    Input:
  623.  *
  624.  *  Returns:
  625.  *
  626.  * Comments:
  627. \*---------------------------------------------------------------------------*/
  628.  
  629. function SetupScreen()
  630.         number nDx, nDy;
  631. begin
  632.         GetExtents( nDx, nDy );
  633.  
  634.         Enable( FULLWINDOWMODE );
  635.  
  636.         Enable( INDVFILESTATUS );
  637.         Enable( BITMAP256COLORS );
  638.         Enable( DIALOGCACHE );
  639.  
  640.         SetTitle( "Installing " + APP_NAME, 24, WHITE );
  641.  
  642.         SetColor( BACKGROUND, BK_BLUE ); // Dark blue.
  643.         SetColor( STATUSBAR, BLUE );            // Bright blue.
  644.  
  645.         SetTitle( "Setup", 0, BACKGROUNDCAPTION ); // Caption bar text.
  646.  
  647.         Enable( BACKGROUND );
  648.  
  649.         Delay( 1 );
  650.  
  651. end;
  652.  
  653.  
  654. /*---------------------------------------------------------------------------*\
  655.  *
  656.  * Function:  CheckRequirements
  657.  *
  658.  *  Purpose:  This function will check all minimum requirements for the
  659.  *            application being installed.  If any fail, then the user
  660.  *            is informed and the installation is terminated.
  661.  *
  662.  *
  663.  *    Input:
  664.  *
  665.  *  Returns:
  666.  *
  667.  * Comments:
  668. \*---------------------------------------------------------------------------*/
  669.  
  670. function CheckRequirements()
  671. number  nvDx, nvDy;
  672. number nvVersion;
  673. STRING szResult;
  674. begin
  675.         // Check screen resolution.
  676.         GetExtents( nvDx, nvDy );
  677.         if (nvDy < 480) then
  678.            MessageBox( "This program requires VGA or better resolution.", WARNING );
  679.            exit;
  680.         endif;
  681. end;
  682. /*------------------------------------------------------------------------
  683.  
  684.     Name    : Ole2Dll() 
  685.     
  686.     Purpose : This function is used to check to make sure the OLE2 Registration and         
  687.                 DLL files are current...
  688.                 
  689. --------------------------------------------------------------------------*/
  690.  
  691. function Ole2Dll()
  692.  
  693. begin
  694.  
  695. /***********************************************************************
  696. Will Run the OLE2 Checking and registration Program!!!!!
  697. **********************************************************************/
  698.         VarSave(SRCTARGETDIR);
  699.         SRCDIR = SRCDISK ^ "OLE2";
  700.         TARGETDIR = WINSYSDIR;
  701.         
  702.         szOLE = "COMPOBJ.DLL";
  703.         lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile);
  704.         szOLE = "OLE2.DLL";
  705.         lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile);
  706.         szOLE = "OLE2PROX.DLL";
  707.         lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile);
  708.         szOLE = "OLE2DISP.DLL";
  709.         lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile);
  710.         szOLE = "OLE2NLS.DLL";
  711.         lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile);
  712.         szOLE = "OLE2CONV.DLL";
  713.         lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile);
  714.         szOLE = "OLE2CONV.DLL";
  715.         lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile);
  716.         szOLE = "STORAGE.DLL";
  717.         lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile);
  718.         szOLE = "TYPELIB.DLL";
  719.         lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile);
  720.         szOLE = "CTL3DV2.DLL";
  721.         lResult = VerSearchAndUpdateFile(szOLE, VER_UPDATE_COND, svInstalledFile);
  722.         
  723.         
  724.             if((FileCompare("Ole2.Reg", "Ole2.Reg", COMPARE_SIZE) = GREATER_THAN) || (FileCompare("Ole2.Reg", "Ole2.Reg", COMPARE_DATE) = GREATER_THAN || FILE_NOT_FOUND))  then
  725.                 CopyFile("Ole2.Reg", "Ole2.Reg");
  726.             endif;
  727.             if((FileCompare("Stdole.TLB", "Stdole.TLB", COMPARE_SIZE) = GREATER_THAN) || (FileCompare("Stdole.TLB", "Stdole.TLB", COMPARE_DATE) = GREATER_THAN || FILE_NOT_FOUND)) then
  728.                 CopyFile("Stdole.TLB", "Stdole.TLB");
  729.             endif;
  730.  
  731.   /*************** Run Regedit automatically...If didn't copy new OLE2.REG, makes sure the registry is corect. *****/      
  732.                 LaunchApp( WINDIR ^ "regedit", " /s  ole2.reg");    
  733.          
  734.          VarRestore(SRCTARGETDIR);
  735.  end;
  736.  
  737. /******************************
  738.  
  739. ******************************/
  740.  
  741. #include "sddialog.rul"
  742.  
  743.